#ifndef RGARESOURCEMANAGER_H
#define RGARESOURCEMANAGER_H

#include <QObject>

#include "rga/im2d.h"
#include "rga/RgaUtils.h"
#include "rga/RgaApi.h"

class RgaResourceManager : public QObject
{
    Q_OBJECT
public:
    RgaResourceManager(QObject *parent = nullptr);
    ~RgaResourceManager();

    bool initialize(int dma_fd, int width, int height, char* dst_buf);
    void release();
    rga_buffer_t* getSrcBuffer();
    rga_buffer_t* getDstBuffer();

private:
    rga_buffer_handle_t src_handle;
    rga_buffer_handle_t dst_handle;
    rga_buffer_t src_buffer = {};
    rga_buffer_t dst_buffer = {};

};

#endif // RGARESOURCEMANAGER_H
